#ifndef PinDebouncer_h
#define PinDebouncer_h

class PinDebouncer
{
    public:

        PinDebouncer(
            unsigned char pinNumber,
            unsigned int minimumUsBetweenPinStateSamples,
    	    unsigned char* pinStateFilterArray,
    	    unsigned char pinStateFilterArraySize);

        void Service(void);
        unsigned char GetPinState(void);
        
    private:
    
        unsigned char mPinNumber;
        unsigned char* mPinStateFilterArray;
        unsigned char mPinStateFilterArraySize;
        
        unsigned long mMinimumUsBetweenPinStateSamples;
        
        unsigned long mLastPinStateSampleAtUs;
};

#endif
